import logging

from apps.settingApi.api.timerTask.apiList.jdYxk.const import APIJSONYXK
from apps.settingApi.api.timerTask.apiList.logsAdd import add
from apps.settingApi.api.timerTask.apiList.u9capi import u9capiPrdt, u9capiIdx, u9capiWh, u9capiCw, u9capiDept, \
    u9capiSalm, u9capiTwTi, u9capiPoTi, u9capiBasic, u9capiCk, u9capiMlSq, u9capiMlSqTl, u9capiPoTh, u9capiSaTh, \
    u9capiFpCl, u9capiZfCk, u9capiZsRk, u9capiDbRk, u9capiCpRk, u9capiPoYsRk, u9capiTwDbCk, u9capiFpZfCk, u9capiWtRk
from apps.settingApi.api.timerTask.apiList.wmsapiUtils import wmsapiPrdt
from apps.settingApi.api.timerTask.apiList.wmsapi import wmsapiPullU9cMlMfCk, wmsapiPullU9cClMfCk, wmsapiPullU9cClMfRk, \
    wmsapiPullU9cZsSh, wmsapiPullU9cZfSh, wmsapiPullU9cZsShMfRk, wmsapiPullU9cZfShMfCk, wmsapiPullU9cPoMfCk, \
    wmsapiPullU9cSaMfPSS, wmsapiPullU9cSbMfPss, wmsapiPullU9cShBiaoZhunShouHuoRow, wmsapiPullU9cMmSh, wmsapiPullU9cCkDb, \
    wmsapiPullU9cTwMmSh, wmsapiPullU9cPanYingKui
from apps.settingApi.switchCase.casePrimaryKey import caseGetPrimaryKeyData


def defaultApi(db,taskObj):
    print(taskObj['name'],"====未定义的方法")
    logging.info(taskObj['name'] + "====未定义的方法")
    logData = {}
    logData['id'] = caseGetPrimaryKeyData()
    logData['status'] = True
    logData['name'] = taskObj['name']
    logData['order'] = taskObj['name']
    logData['data'] = taskObj['name']
    logData['rem'] = '未定义的方法'
    add(db,logData)
    return

# u9c的api配置
APIJSONU9C = {
    "u9capiBasic": u9capiBasic,
    "u9capiPrdt": u9capiPrdt,
    "u9capiIdx": u9capiIdx,
    "u9capiWh": u9capiWh,
    "u9capiCw": u9capiCw,
    "u9capiDept": u9capiDept,
    "u9capiSalm": u9capiSalm,
    "u9capiTwTi": u9capiTwTi,
    "u9capiPoTi": u9capiPoTi,
    "u9capiCk": u9capiCk,
    "u9capiMlSq": u9capiMlSq,
    "u9capiMlSqTl": u9capiMlSqTl,
    "u9capiPoTh": u9capiPoTh,
    "u9capiSaTh": u9capiSaTh,
    "u9capiFpCl": u9capiFpCl,
    "u9capiZfCk": u9capiZfCk,
    "u9capiZsRk": u9capiZsRk,
    "u9capiDbRk": u9capiDbRk,
    "u9capiCpRk": u9capiCpRk,
    "u9capiPoYsRk": u9capiPoYsRk,
    "u9capiTwDbCk": u9capiTwDbCk,
    "u9capiFpZfCk": u9capiFpZfCk,
    "u9capiWtRk": u9capiWtRk,
}

# wms的api配置
APIJSONWMS = {
    "wmsapiPrdt": wmsapiPrdt,
    # "wmsapiPullU9cMlMfCk": wmsapiPullU9cMlMfCk,
    "wmsapiPullU9cClMfCk": wmsapiPullU9cClMfCk,
    "wmsapiPullU9cClMfRk": wmsapiPullU9cClMfRk,
    "wmsapiPullU9cZsSh": wmsapiPullU9cZsSh,
    "wmsapiPullU9cZfSh": wmsapiPullU9cZfSh,
    "wmsapiPullU9cZsShMfRk": wmsapiPullU9cZsShMfRk,
    "wmsapiPullU9cZfShMfCk": wmsapiPullU9cZfShMfCk,
    "wmsapiPullU9cPoMfCk": wmsapiPullU9cPoMfCk,
    "wmsapiPullU9cSaMfPSS": wmsapiPullU9cSaMfPSS,
    "wmsapiPullU9cSbMfPss": wmsapiPullU9cSbMfPss,
    "wmsapiPullU9cShBiaoZhunShouHuoRow": wmsapiPullU9cShBiaoZhunShouHuoRow,
    "wmsapiPullU9cMmSh": wmsapiPullU9cMmSh,
    "wmsapiPullU9cCkDb": wmsapiPullU9cCkDb,
    "wmsapiPullU9cTwMmSh": wmsapiPullU9cTwMmSh,
    "wmsapiPullU9cPanYingKui": wmsapiPullU9cPanYingKui,
}

# api注册
APIJSONDATA = {
    "defaultApi": defaultApi,
    **APIJSONU9C, **APIJSONWMS,**APIJSONYXK
}
